/**
 * util.inspect() 将对象转化为字符串
 */
const util = require('util');
function Person(){
    this.name = '张三';
    this.age = 18;
    this.sex = '男';
    this.hobby = ['篮球','足球','羽毛球'];
    this.showName = function(){
        return this.name;
    }
}
let man = new Person();
console.log(util.inspect(man));
console.log(util.inspect(man,{showHidden:true,depth:null}));
console.log(util.inspect(man,{showHidden:true,depth:1}));
console.log(util.inspect(man,{showHidden:true,depth:2}));
console.log(util.inspect(man,true));
console.log(util.inspect(man,{colors:true}));